include nesdefines.s

; ---------- ZERO PAGE -------------
ENUM VM_TOP
;	VM_BTM: .dsb $20
;	VM_TOP: .db 0
	PAL_BUF: .dsb $20
	FRAMES: .db 0
	FRAMECNT=FRAMES
	PPU_CTRL_VAR: .db 0
	PPU_MASK_VAR: .db 0
	FORCED_BLANK: .db 0
	SCROLL_X: .db 0
	SCROLL_Y: .db 0
	OAM_ATTR_FLAGS: .db 0
	OAM_PTR: .db 0
	CURRENT_BANK: .db 0
	TEMP: .dsb 32
	OBJ_INDEX: .db 0  ; current object #, offset into interleaved array of byte properties
	PAD_STATE: .db 0
	PAD_STATEL: .db 0
	SCENE: .db 0 ; scene ID
	OVERWORLD_POS: .db 0

; objects
	NUM_OBJECTS = 8
	align 8
	OBJXlow: .dsb NUM_OBJECTS
	OBJXhigh: .dsb NUM_OBJECTS
	OBJYlow: .dsb NUM_OBJECTS
	OBJYhigh: .dsb NUM_OBJECTS
	OBJVXlow: .dsb NUM_OBJECTS
	OBJVXhigh: .dsb NUM_OBJECTS
	OBJVYlow: .dsb NUM_OBJECTS
	OBJVYhigh: .dsb NUM_OBJECTS
	OBJType: .dsb NUM_OBJECTS


ENDE
; ----------------------------------

; ----------- Stack Area  ----------

ENUM $100 ;$80+ (128) available

ENDE

; ----------------------------------

; $200 reserved for OAM_BUF

; ------------- WRAM ---------------

ENUM $300   ;$500 (1280) available

	TILEMAP_BUF: .dsb 192

ENDE

; ----------------------------------


NES_MAPPER=2  ; UNROM

	.db $4e,$45,$53,$1a        ; NES,eof
	;4
	.db 8 ;NES_PRG_BANKS  - 128KB
	.db 0 ;NES_CHR_BANKS  - no CHR ROM
	.db 3|NES_MAPPER<<4 ;flags 6 - vertical mirroring, battery backed SRAM
	.db $08 ; NES 2.0
	;8
	.db 0
	.db 0
	.db $07 ;8KB BATTERY BACKED
	.db $70 ;8KB CHR RAM NOT BATTERY BACKED
	;12
	.db 0,0,0,0

base $8000
include bank00.s
pad $c000

base $8000
pad $c000

base $8000
pad $c000

base $8000
pad $c000

base $8000
pad $c000

base $8000
pad $c000

base $8000
include bank06.s
pad $c000

; last bank
base $c000
include bank07_dtc.s


